package com.example.view.mvp;

import android.content.Context;
import android.content.Intent;

import com.example.common.utils.L;
import com.example.common.vp.BaseActivity;
import com.example.view.R;
import com.example.view.databinding.ActVpHomeBinding;
import com.example.view.mvp.bean.TestRankingBean;


public class HomeActivity extends BaseActivity<ActVpHomeBinding, HomePresenter> implements HomeContract.View {

    public static void open(Context context) {
        Intent intent = new Intent(context, HomeActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void main() {
        super.main();
    }

    @Override
    protected HomePresenter getPresenter() {
        return new HomePresenter();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.act_vp_home;
    }

    @Override
    protected void initListener() {

    }

    @Override
    public void showRequestError(String msg, String code) {

    }

    @Override
    public void showDialog(String msg) {
        L.e(TAG, "showDialog" + msg);
    }

    @Override
    public void dismissDialog() {
        L.e(TAG, "dismissDialog");
    }

    @Override
    public void showHomeData(TestRankingBean data) {
        L.e(TAG, "data--" + data.getMsg());
        mBinding.tvMsg.setText(data.getMsg());
    }
}
